package com.jn.goods.dao;

import com.jn.goods.pojo.Spec;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface SpecMapper extends Mapper<Spec> {
    /**
     * 根据分类名称查询规格列表
     */
    @Select("SELECT name,options FROM tb_spec \n" +
            "WHERE template_id in (SELECT id FROM tb_template \n" +
            "WHERE `name` in(SELECT `name` FROM tb_category WHERE name =#{name}))")
    List<Map> findSpecByCategoryName(@Param("name") String categoryName);
}
